package cn.z2huo.demo.spring.boot.objectprovider;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * <p>
 *
 * @author z2huo
 */
//@Component
@RequiredArgsConstructor
class Test {

    private final ServiceA serviceA;

    /**
     * 启动失败，因为 {@link ServiceB} 上没有添加 {@link Component} 注解

         ***************************
         APPLICATION FAILED TO START
         ***************************

         Description:

         Parameter 1 of constructor in cn.z2huo.demo.spring.boot.objectprovider.Test required a bean of type 'cn.z2huo.demo.spring.boot.objectprovider.ServiceB' that could not be found.

         Action:

         Consider defining a bean of type 'cn.z2huo.demo.spring.boot.objectprovider.ServiceB' in your configuration.

     */
    private final ServiceB serviceB;

    public void test() {
        serviceA.doSomething();
        serviceB.doSomething();
    }

}
